home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pbmpl91d.zip / PBMPLUS / MAN / PGM.MAN < prev    next >
Text File  |  1993-01-08  |  3KB  |  132 lines

  1.  
  2.  
  3. pgm(5)                     Unix Programmer's Manual                     pgm(5)
  4.  
  5.  
  6. NAME
  7.      pgm - portable graymap file format
  8.  
  9. DESCRIPTION
  10.      The portable graymap format is a lowest common denominator grayscale file
  11.      format.  The definition is as follows:
  12.  
  13.      - A "magic number" for identifying the file type.   A  pgm  file's  magic
  14.        number is the two characters "P2".
  15.  
  16.      - Whitespace (blanks, TABs, CRs, LFs).
  17.  
  18.      - A width, formatted as ASCII characters in decimal.
  19.  
  20.      - Whitespace.
  21.  
  22.      - A height, again in ASCII decimal.
  23.  
  24.      - Whitespace.
  25.  
  26.      - The maximum gray value, again in ASCII decimal.
  27.  
  28.      - Whitespace.
  29.  
  30.      - Width * height gray values, each in ASCII decimal, between  0  and  the
  31.        specified  maximum value, separated by whitespace, starting at the top-
  32.        left corner of the graymap, proceeding in normal English reading order.
  33.        A value of 0 means black, and the maximum value means white.
  34.  
  35.      - Characters from a "#" to the next end-of-line are ignored (comments).
  36.  
  37.      - No line should be longer than 70 characters.
  38.  
  39.      Here is an example of a small graymap in this format:
  40.      P2
  41.      # feep.pgm
  42.      24 7
  43.      15
  44.      0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
  45.      0  3  3  3  3  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15 15 15 15  0
  46.      0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0 15  0
  47.      0  3  3  3  0  0  0  7  7  7  0  0  0 11 11 11  0  0  0 15 15 15 15  0
  48.      0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0  0  0
  49.      0  3  0  0  0  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15  0  0  0  0
  50.      0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
  51.  
  52.      Programs that  read  this  format  should  be  as  lenient  as  possible,
  53.      accepting anything that looks remotely like a graymap.
  54.  
  55.      There is also a variant on the format, available by setting  the  RAWBITS
  56.      option at compile time.  This variant is different in the following ways:
  57.  
  58.      - The "magic number" is "P5" instead of "P2".
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                               12 November 1991                               1
  65.  
  66.  
  67.  
  68. pgm(5)                     Unix Programmer's Manual                     pgm(5)
  69.  
  70.  
  71.      - The gray values are stored as plain bytes, instead of ASCII decimal.
  72.  
  73.      - No whitespace is allowed in  the  grays  section,  and  only  a  single
  74.        character  of  whitespace  (typically  a  newline) is allowed after the
  75.        maxval.
  76.  
  77.      - The files are smaller and many times faster to read and write.
  78.  
  79.      Note that this raw format can only be used for maxvals less than or equal
  80.      to 255.  If you use the pgm library and try to write a file with a larger
  81.                              ---
  82.      maxval, it will automatically fall back on the slower  but  more  general
  83.      plain format.
  84.  
  85. SEE ALSO
  86.      fitstopgm(1),  fstopgm(1),  hipstopgm(1),  lispmtopgm(1),   psidtopgm(1),
  87.      rawtopgm(1),   pgmbentley(1),  pgmcrater(1),  pgmedge(1),  pgmenhance(1),
  88.      pgmhist(1),    pgmnorm(1),    pgmoil(1),    pgmramp(1),    pgmtexture(1),
  89.      pgmtofits(1),  pgmtofs(1),  pgmtolispm(1),  pgmtopbm(1),  pnm(5), pbm(5),
  90.      ppm(5)
  91.  
  92. AUTHOR
  93.      Copyright (C) 1989, 1991 by Jef Poskanzer.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                               12 November 1991                               2
  131.  
  132.